#ifndef BOARD_H
#define BOARD_H
#include "Stone.h"

#include <QWidget>

class Board : public QWidget
{
    Q_OBJECT
public:
    explicit Board(QWidget *parent = 0);
    ~Board();

    void paintEvent(QPaintEvent *);

    Stone _s[32];
    void drawStone(QPainter &painter, int id);
    int _d=30; // 棋子的直径
    QPoint center(int row, int col);
    QPoint center(int id);
//    void mousePressEvent(QMouseEvent *);
    void mouseReleaseEvent(QMouseEvent *);
    int _selected=-1;
    bool canMove(int id, int x,int y);

    bool isRedStep=true;

    bool canMoveOfZHU(int selectId, int xPos, int yPos);
    bool canMoveOfMA(int selectId, int xPos, int yPos);
    bool canMoveOfPao(int selectId, int xPos, int yPos);
    bool canMoveOfXIANG(int selectId, int xPos, int yPos);
    bool canMoveOfSHI(int selectId, int xPos, int yPos);
    bool canMoveOfJIANG(int selectId, int xPos, int yPos);
    bool canMoveOfBING(int selectId, int xPos, int yPos);

    bool isSameType(int id, int xPos,int yPos);
signals:

public slots:
};

#endif // BOARD_H
